home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_097 / graphit / graph.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  128 lines

  1. /****************************************************************************/
  2. /*   Program: Graph It II    (The C Program)                                    */
  3. /*   SubModule:    graph.h  1-20-87                                            */
  4. /*   CopyRight By Flynn D. Fishman  January 1987                            */
  5. /*    Feel Free to copy and alter this source                                    */
  6. /****************************************************************************/
  7. /* This is the include file for graph it.  It includes all the needed 
  8.     constants                                                                */
  9.  
  10. #include <stdio.h>
  11. #include <math.h>
  12. #include <functions.h>
  13. #include <exec/types.h>
  14.  
  15. #include <exec/exec.h>
  16. #include <intuition/intuition.h>
  17. #include <intuition/intuitionbase.h>
  18. #include <graphics/gfx.h>
  19. #include <graphics/gfxmacros.h>
  20. #include <graphics/regions.h>
  21. #include <graphics/copper.h>
  22. #include <graphics/gels.h>
  23. #include <graphics/gfxbase.h>
  24. #include <graphics/text.h>
  25. #include <devices/keymap.h>
  26. #include <hardware/blit.h>
  27.  
  28. /* this is close enough    */
  29. #define INFINITY   932768;
  30.  
  31. /* number of elements to allocate for formula */
  32. #define PARAMETERS 90
  33. #define FSIZE      50
  34. #define CONSTANTS  50
  35.  
  36. /* types of characters    */
  37. #define ALPHA         1
  38. #define NUMERIC     2
  39. #define OTHER        3
  40. #define END         4    /* i.e. \r, \n or a semicolon    */
  41.  
  42. #define BITMASK     0xff 
  43. #define HIGHBIT        0x80    
  44. #define LOWMASK     0x7f
  45.  
  46. /* types of formula errors    */
  47. #define UNKNOWN    2
  48. #define INVALID    3
  49. #define WINDOW    4
  50.  
  51. #define ever (;;)
  52.  
  53. struct Formula_Master 
  54.     {
  55.     char    *equation;
  56.     double    *constants;
  57.     int         position;
  58.     int         error;
  59.     };
  60.  
  61. struct Graph_Parameters
  62.     {
  63.     struct Formula_Master   *x1;
  64.     struct Formula_Master    *y1;
  65.     struct Formula_Master    *z1;
  66.     int                        yon;
  67.     int                        xon;
  68.     int                        zon;
  69.     int                        end;
  70.     int                        hidden;
  71.     double                    xstart;
  72.     double                    ystart;
  73.     double                    zstart;
  74.     double                    tstart;
  75.     double                    xend;
  76.     double                    yend;
  77.     double                    zend;
  78.     double                    tend;
  79.     double                    xlabels;
  80.     double                    ylabels;
  81.     double                    zlabels;
  82.     double                    detail;
  83.     int                        error;
  84.     };
  85.  
  86. double x, y, t, z;
  87. double Value(), Solve(), GetNum();
  88. char *AllocateFunction();
  89.  
  90. #define INTUITION_REV 1l
  91. #define GRAPHICS_REV  1l
  92.  
  93. #define XSIZE       640l
  94. #define YSIZE       200l
  95.  
  96. #define min(x,y)    (x<y)?x:y
  97. #define max(x,y)    (x<y)?y:x
  98. #define abs(x)        (x<0)?-x:x
  99.  
  100. /* Icon placement constants */
  101. #define XBORDER        28    /* pixels on right side of graph area    */
  102. #define YBORDER     16    /* pixels below graoh area                */
  103. #define XEXPANDX    56  /* Number of pixels for xstart =         */
  104. #define XEXPANDY    8    /* The hieght of the xexpand area        */
  105. #define YEXPANDX    9    /* the width of the yexpand area        */
  106. #define YEXPANDY    17    /* pixels for ystart =                     */
  107. #define ICONX        16    /* The width of the icon                */
  108. #define ICONY        15    /* The hieght of the command icons        */
  109. #define BALLHEIGHT  5
  110. #define BALLWIDTH    6
  111.  
  112. /* modes for graph    */
  113. #define ZOOM    1
  114. #define MOVE    2
  115. #define TOTALAREA 4.0
  116.  
  117. /* Help menu stuff    */
  118. #define        FORWARD        1
  119. #define        BACKWARD    2
  120. #define        QUIT        3
  121.  
  122. #define        FIRSTPAGE    1
  123. #define        LASTPAGE    5
  124.  
  125. #ifndef PI
  126. #define PI    3.14159265358979    /* From memory, may not be correct */
  127. #endif
  128.